package com.css.fxfzdzzh.modules.basicData.repository.impl;

import com.css.fxfzdzzh.modules.basicData.vo.LithologyVO;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author Dbj
 * @date 2023年03月02日  15:34
 */
@Repository
public class LithologyRepository {

    @Resource
    private JdbcTemplate jdbcTemplate;

    public List<LithologyVO> getLithologyList() {
        String sql = "select gy.dsl_code,ric.petrlfabric_type from dzzh_sys_lithology gy,dzzh_sys_lithology_petrofabric ric" +
                " where gy.petrofabric=ric.dslp_id";
        return jdbcTemplate.query(sql,new BeanPropertyRowMapper<>(LithologyVO.class));
    }
}
